<div id="right">


<h1>Create term <span style="color: red;"><?php if(isset($vocabulary)) : echo $vocabulary; endif; ?></span></h1>
<input type="button" name="gencode" class="button dialog_link" value="Generar Code"/>

<!-- ui-dialog -->
<div id="dialog" title="Generar Code Module">
	<p>Structured: </p>
	<p>• Modules : <b><?php echo $vocabulary; ?></b>
    <pre>
[-] Controllers:
    [+] <?php echo $vocabulary; ?>.php [<i style="color: green;">TRUE</i>]
[-] Models:
    [+] m_<?php echo $vocabulary; ?>.php [<i style="color: green;">TRUE</i>]
[-] Views:
    [+] v_index.php [<i style="color: green;">TRUE</i>]
    [+] v_create.php [<i style="color: green;">TRUE</i>]
    [+] v_delete.php [<i style="color: red;">FALSE</i>]
    [+] v_read.php [<i style="color: green;">TRUE</i>]
    [+] v_update.php [<i style="color: green;">TRUE</i>]
    </pre>
    <a href="<?php echo base_url("taxonomy/createTerm/".$vocabulary."/gencode"); ?>" style="border: 1px dashed gray; padding: 3px; text-decoration: none;" >» Generar code</a>
</div>

<?php if(isset($message) == true){?>
<div class="notice">
	<code><?php echo $message; ?></code>
</div>
<?php }?>
<?php echo validation_errors();
 ?>
 <br/><br/>
<iframe src="http://localhost/phpmyadmin/tbl_structure.php?db=<?php echo $this->other->getdb; ?>&goto=db_structure.php&table=<?php echo $vocabulary; ?>" width="100%" height="360px" style="border: none;"></iframe>
<?php echo form_open('term/create'); ?>


</form>
</div>

<script type="text/javascript">
$(document).ready(function(){
    //$(".name_term").appendTo(".field_clone");
   $(".block_value_term").hide();
    $(".name_term").keyup(function(event){
        $name_term   = $(".name_term").val();
        $(".field_clone").html("<span class='block_clone'>Value term: <span clas='field_filter_clone'>"+locdau($name_term)+"</span> <a href='#' class='edit_name_term'>[Edit]</a></span>");
        $(".value_term").val(locdau($name_term));
    });
    $(".edit_name_term").live("click", function()
    {
        $(".block_value_term").show();
        $(".block_clone").hide();
    })
  function locdau(str) {  
      str= str.toLowerCase();  
      str= str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g,"a");  
      str= str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g,"e");  
      str= str.replace(/ì|í|ị|ỉ|ĩ/g,"i");  
      str= str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g,"o");  
      str= str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g,"u");  
      str= str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g,"y");  
      str= str.replace(/đ/g,"d");  
      str= str.replace(/!|@|%|\^|\*|\(|\)|\+|\=|\<|\>|\?|\/|,|\.|\:|\;|\'| |\"|\&|\#|\[|\]|~|$|_/g,"_"); 
    /* tìm và thay thế các kí tự đặc biệt trong chuỗi sang kí tự - */ 
      str= str.replace(/_+_/g,"_"); //thay thế 2- thành 1- 
      str= str.replace(/^\_+|\_+$/g,"");  
    //cắt bỏ ký tự - ở đầu và cuối chuỗi  
      return str;  
  }   

});
</script>

